package cn.xing.managementSystem.service;

import cn.xing.managementSystem.domain.SysUser;
import cn.xing.managementSystem.repository.SysUserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author cuixing
 * @package cn.xing.managementSystem.service.sys
 * @class SysUserService
 * @email xing.cui@magicwindow.cn
 * @date 2018/4/21 上午11:42
 * @description
 */

@Service
public class SysUserService {

    @Autowired
    private SysUserRepository sysUserRepository;


    public SysUser getSysUserByUsername(String username){
        return sysUserRepository.findByUsernameAndAndDeletedIsFalse(username);
    }

    public SysUser saveSysUser(SysUser sysUser){
        return sysUserRepository.saveAndFlush(sysUser);
    }
}